<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.thymeleaf.org"
      layout:decorator="layout/pc_master">
<div layout:fragment="content" class="section page-content">
<style type="text/css">
    .layui-form-label { width: 150px; }
    .layui-input-block { margin-left:150px; }
    .layui-input, .layui-select, .layui-textarea { border-color:#EEE; border-radius: 5px; color: var(--color) }
    .mulselect_box .layui-unselect{ width: 150px; display: inline-block; }
</style>
    <!-- s: 导航 -->
    <div class="breadcrumb-wrap">
        <div class="layui-main clearfix">
            <div class="breadcrumb">
                <a href="/">首页</a> - <a href="/center">用户中心</a> - 单身资料
            </div>
        </div>
    </div>
    <!-- e: 导航 -->

    <div class="section page-content">
        <div class="layui-main clearfix">

         <div th:include="layout/center_left :: center_left" class="manage-aside"></div>

        <div class="manage-main">
            <ul class="layui-nav nav main-nav">
                <li class="layui-nav-item ">
                    <a href="/center/single/info">
                        基本资料
                    </a>
                </li>
                <li class="layui-nav-item layui-this">
                    <a href="/center/single/mate">
                        择偶标准
                    </a>
                </li>
                <li class="layui-nav-item ">
                    <a href="/center/single/photo">
                        头像
                    </a>
                </li>
                <li class="layui-nav-item ">
                    <a href="/center/single/show">
                        个性展示
                    </a>
                </li>
            </ul>
            <div class="main-content">
                <form class="layui-form" action="/m/ajax/center/single/pc_modify_mate" bottlecms-form-ajax=""
                      refresh="refresh" method="post" onsubmit="return changeData()">
                    <div class="layui-form-item">
                        <label class="layui-form-label">对方性别</label>
                        <div class="layui-input-inline">
                            <label class="radio-inline c-radio">
                                <input bottlecms-radio="" type="radio" name="mateGender"
                                       value="1" th:checked="${mate.mateGender eq 1}" title="男士">
                                <div class="layui-unselect layui-form-radio layui-form-radioed">
                                    <i class="layui-anim layui-icon">
                                </i><div>男士</div></div></label>
                            <label class="radio-inline c-radio">
                            <input bottlecms-radio="" type="radio" name="mateGender"
                                   th:checked="${mate.mateGender eq 2}" value="2" title="女士">
                            <div class="layui-unselect layui-form-radio">
                                <i class="layui-anim layui-icon"></i><div>女士</div></div></label>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label">对方年龄</label>
                        <div class="layui-input-block">
                            <input hidden="hidden" id="mateAge" name="mateAge">
                            <div class="layui-input-inline" style="width: 100px;">
                                <select bottlecms-select="" name="mateAgeMin">
                                    <option value="">不限</option>
                                    <option th:each="item:${baseAge}" th:value="${item}"
                                            th:selected="${item eq mate.mateAgeMin}" th:text="${item}+'岁'"></option>
                                </select>
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 100px;">
                                <select bottlecms-select="" name="mateAgeMax">
                                    <option value="">不限</option>
                                    <option th:each="item:${baseAge}" th:value="${item}"
                                            th:selected="${item eq mate.mateAgeMax}" th:text="${item}+'岁'"></option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方身高</label>
                        <div class="layui-input-block">
                            <input type="hidden" id="mateHeight" name="mateHeight">
                            <div class="layui-input-inline" style="width: 100px;">
                                <select bottlecms-select="" name="mateHeightMin">
                                    <option value="">不限</option>
                                    <option th:each="item:${baseHeight}" th:value="${item}"
                                            th:selected="${item eq mate.mateHeightMin}" th:text="${item}+'cm'"></option>
                                </select>
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 100px;">
                                <select bottlecms-select="" name="mateHeightMax">
                                    <option value="">不限</option>
                                    <option th:each="item:${baseHeight}" th:value="${item}"
                                            th:selected="${item eq mate.mateHeightMax}" th:text="${item}+'cm'"></option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方体重</label>
                        <div class="layui-input-block">
                            <input type="hidden" id="mateWeight" name="mateWeight">
                            <div class="layui-input-inline" style="width: 100px;">
                                <select bottlecms-select="" name="mateWeightMin">
                                    <option value="">不限</option>
                                    <option th:each="item:${baseWeight}" th:value="${item}"
                                            th:selected="${item eq mate.mateWeightMin}" th:text="${item}+'kg'"></option>
                                </select>
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 100px;">
                                <select bottlecms-select="" name="mateWeightMax">
                                    <option value="">不限</option>
                                    <option th:each="item:${baseWeight}" th:value="${item}"
                                            th:selected="${item eq mate.mateWeightMax}" th:text="${item}+'kg'"></option>
                                </select>
                            </div>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label">对方收入</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateIncomeCn" name="mateIncomeCn">
                            <select bottlecms-select="" name="mateIncome">
                                <option value="">不限</option>
                                <option th:each="item:${baseIncome}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateIncome eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方学历</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateEducationCn" name="mateEducationCn">
                            <select bottlecms-select="" name="mateEducation">
                                <option value="">不限</option>
                                <option th:each="item:${baseEducation}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateEducation eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方所在地</label>
                        <div class="layui-input-block mulselect_box">
                            <input type="hidden" id="mateDistrict" name="mateDistrict">
                            <input type="hidden" id="mateDistrictCn" name="mateDistrictCn">
                            <select bottlecms-mulselect="categoryDistricts" seluuid="600a805a31b56" selindex="0"
                                    name="mate_district_1">
                                <option value="">不限</option>
                                <option th:each="item:${listProvince}" th:value="${item.id}"
                                        th:selected="${item.id eq distrcitProvinceId}"
                                        th:text="${item.name}"></option>
                            </select>
                            <select bottlecms-mulselect="categoryDistricts" seluuid="600a805a31b56" selindex="1"
                                    name="mate_district_2">
                                <option value="">不限</option>
                                <option th:each="item:${distrcitListCity}" th:value="${item.id}"
                                        th:selected="${item.id eq distrcitCityId}"
                                        th:text="${item.name}"></option>
                            </select>
                            <select bottlecms-mulselect="categoryDistricts" seluuid="600a805a31b56" selindex="2"
                                    name="mate_district_3">
                                <option value="">不限</option>
                                <option th:each="item:${distrcitListArea}" th:value="${item.id}"
                                        th:selected="${item.id eq distrcitAreaId}"
                                        th:text="${item.name}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方籍贯</label>
                        <div class="layui-input-block mulselect_box">
                            <input type="hidden" id="mateNativePlace" name="mateNativePlace">
                            <input type="hidden" id="mateNativePlaceCn" name="mateNativePlaceCn">
                            <select bottlecms-mulselect="categoryDistricts" seluuid="600a805a32184" selindex="0"
                                    name="mate_native_place_1">
                                <option value="">不限</option>
                                <option th:each="item:${listProvince}" th:value="${item.id}"
                                        th:selected="${item.id eq distrcitProvinceId}"
                                        th:text="${item.name}"></option>
                            </select>

                            <select bottlecms-mulselect="categoryDistricts" seluuid="600a805a32184" selindex="1"
                                    name="mate_native_place_2">
                                <option value="">不限</option>
                                <option th:each="item:${nativeplaceListCity}" th:value="${item.id}"
                                        th:selected="${item.id eq nativeplaceCityId}"
                                        th:text="${item.name}"></option>
                            </select>

                            <select bottlecms-mulselect="categoryDistricts" seluuid="600a805a32184" selindex="2"
                                    name="mate_native_place_3">
                                <option value="">不限</option>
                                <option th:each="item:${nativeplaceListArea}" th:value="${item.id}"
                                        th:selected="${item.id eq nativeplaceAreaId}"
                                        th:text="${item.name}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方民族</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateNationalityCn" name="mateNationalityCn">
                            <select bottlecms-select="" name="mateNationality">
                                <option value="">不限</option>
                                <option th:each="item:${baseNationality}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateNationality eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方婚姻状态</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateMarriageCn" name="mateMarriageCn">
                            <select bottlecms-select="" name="mateMarriage">
                                <option value="">不限</option>
                                <option th:each="item:${baseMarriage}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateMarriage eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方孩子情况</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateChildrenCn" name="mateChildrenCn">
                            <select bottlecms-select="" name="mateChildren">
                                <option value="">不限</option>
                                <option th:each="item:${baseChildren}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateChildren eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方房产情况</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateHouseCn" name="mateHouseCn">
                            <select bottlecms-select="" name="mateHouse">
                                <option value="">不限</option>
                                <option th:each="item:${baseHouse}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateHouse eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方购车情况</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateCarCn" name="mateCarCn">
                            <select bottlecms-select="" name="mateCar">
                                <option value="">不限</option>
                                <option th:each="item:${baseCar}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateCar eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方宗教</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateReligiousCn" name="mateReligiousCn">
                            <select bottlecms-select="" name="mateReligious">
                                <option value="">不限</option>
                                <option th:each="item:${baseReligious}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateReligious eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方性格</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateDispositionCn" name="mateDispositionCn">
                            <select bottlecms-select="" name="mateDisposition">
                                <option value="">不限</option>
                                <option th:each="item:${baseDisposition}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateDisposition eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方结婚计划</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateMarryCn" name="mateMarryCn">
                            <select bottlecms-select="" name="mateMarry">
                                <option value="">不限</option>
                                <option th:each="item:${baseMarry}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateMarry eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方家庭背景</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateFamilyBackgCn" name="mateFamilyBackgCn">
                            <select bottlecms-select="" name="mateFamilyBackg">
                                <option value="">不限</option>
                                <option th:each="item:${baseFamilybackg}" th:value="${item.id}"
                                        th:text="${item.name}" th:selected="${mate.mateFamilyBackg eq item.id}"></option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">对方星座</label>
                        <div class="layui-input-inline">
                            <input type="hidden" id="mateConstellationCn" name="mateConstellationCn">
                            <select bottlecms-select="" name="mateConstellation">
                                <option value="">不限</option>
                                <option value="1" th:selected="${mate.mateConstellation eq 1}">水瓶座</option>
                                <option value="2" th:selected="${mate.mateConstellation eq 2}">双鱼座</option>
                                <option value="3" th:selected="${mate.mateConstellation eq 3}">白羊座</option>
                                <option value="4" th:selected="${mate.mateConstellation eq 4}">金牛座</option>
                                <option value="5" th:selected="${mate.mateConstellation eq 5}">双子座</option>
                                <option value="6" th:selected="${mate.mateConstellation eq 6}">巨蟹座</option>
                                <option value="7" th:selected="${mate.mateConstellation eq 7}">狮子座</option>
                                <option value="8" th:selected="${mate.mateConstellation eq 8}">处女座</option>
                                <option value="9" th:selected="${mate.mateConstellation eq 9}">天秤座</option>
                                <option value="10" th:selected="${mate.mateConstellation eq 10}">天蝎座</option>
                                <option value="11" th:selected="${mate.mateConstellation eq 11}">射手座</option>
                                <option value="12" th:selected="${mate.mateConstellation eq 12}">摩羯座</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item" style="margin-top: 50px;">
                        <div class="layui-input-block">
                            <button class="layui-btn layui-btn-default layui-btn-lg  layui-btn-radius" lay-submit="">确认提交</button>
                        </div>
                    </div>
                </form>

            </div>

        </div>


        </div>
    </div>

</div>
<div layout:fragment="contentFooter">
<script>
    function changeData(){
        var mateAgeMin=$("#mateAgeMin").val();
        var mateAgeMax=$("#mateAgeMax").val();
        if (mateAgeMin!="不限" && mateAgeMax!="不限"){
            $("#mateAge").val(mateAgeMin+"~"+mateAgeMax);
        }
        var mateHeightMin=$("#mateHeightMin").val();
        var mateHeightMax=$("#mateHeightMax").val();
        if (mateHeightMin!="不限" && mateHeightMax!="不限"){
            $("#mateHeight").val(mateHeightMin+"~"+mateHeightMax);
        }
        var mateWeightMin=$("#mateWeightMin").val();
        var mateWeightMax=$("#mateWeightMax").val();
        if (mateWeightMin!="不限" && mateWeightMax!="不限"){
            $("#mateWeight").val(mateWeightMin+"~"+mateWeightMax);
        }
        var mateIncome=$("select[name='mateIncome']").find('option:selected').text();
        $("#mateIncomeCn").val(mateIncome);
        var mateEducation=$("select[name='mateEducation']").find('option:selected').text();
        $("#mateEducationCn").val(mateEducation);
        var mate_district_1=$("select[name='mate_district_1']").find('option:selected');
        var mate_district_2=$("select[name='mate_district_2']").find('option:selected');
        var mate_district_3=$("select[name='mate_district_3']").find('option:selected');
        $("#mateDistrict").val(mate_district_1.val()+"."+mate_district_2.val()+"."+mate_district_3.val());
        $("#mateDistrictCn").val(
            (mate_district_1.text()=="不限"?"":mate_district_1.text())
            +"."+
            (mate_district_2.text()=="不限"?"":mate_district_2.text())
            +"."+
            (mate_district_3.text()=="不限"?"":mate_district_3.text())
        );
        var mate_native_place_1=$("select[name='mate_native_place_1']").find('option:selected');
        var mate_native_place_2=$("select[name='mate_native_place_2']").find('option:selected');
        var mate_native_place_3=$("select[name='mate_native_place_3']").find('option:selected');
        $("#mateNativePlace").val(mate_native_place_1.val()+"."+mate_native_place_2.val()+"."+mate_native_place_3.val());
        $("#mateNativePlaceCn").val(
            (mate_native_place_1.text()=="不限"?"":mate_native_place_1.text())
            +"."+
            (mate_native_place_2.text()=="不限"?"":mate_native_place_2.text())
            +"."+
            (mate_native_place_3.text()=="不限"?"":mate_native_place_3.text())
        );
        var mateNationality=$("select[name='mateNationality']").find('option:selected').text();
        $("#mateNationalityCn").val(mateNationality);
        var mateMarriage=$("select[name='mateMarriage']").find('option:selected').text();
        $("#mateMarriageCn").val(mateMarriage);
        var mateChildren=$("select[name='mateChildren']").find('option:selected').text();
        $("#mateChildrenCn").val(mateChildren);
        var mateHouse=$("select[name='mateHouse']").find('option:selected').text();
        $("#mateHouseCn").val(mateHouse);
        var mateCar=$("select[name='mateCar']").find('option:selected').text();
        $("#mateCarCn").val(mateCar);
        var mateReligious=$("select[name='mateReligious']").find('option:selected').text();
        $("#mateReligiousCn").val(mateReligious);
        var mateDisposition=$("select[name='mateDisposition']").find('option:selected').text();
        $("#mateDispositionCn").val(mateDisposition);
        var mateMarry=$("select[name='mateMarry']").find('option:selected').text();
        $("#mateMarryCn").val(mateMarry);
        var mateFamilyBackg=$("select[name='mateFamilyBackg']").find('option:selected').text();
        $("#mateFamilyBackgCn").val(mateFamilyBackg);
        var mateConstellation=$("select[name='mateConstellation']").find('option:selected').text();
        $("#mateConstellationCn").val(mateConstellation);
    }
</script>
</div>
</html>